package com.woniuxy.woniubook.controller;


import com.woniuxy.woniubook.entity.China;
import com.woniuxy.woniubook.entity.User;
import com.woniuxy.woniubook.service.ChinaService;
import com.woniuxy.woniubook.service.UserService;
import com.woniuxy.woniubook.uitl.CookieUtil;
import com.woniuxy.woniubook.uitl.JwtUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wugd
 * @since 2022-11-16 02:13:11
 */
@RestController
@RequestMapping("/china")
public class ChinaController {
    @Autowired
    ChinaService chinaService ;

    @RequestMapping("/province")
    public List<China> initProvince(){
        List<China> list = chinaService.getProvince();
        return list ;
    }

    @RequestMapping("/city")
    public List<China> getCityByPro(int proId){
        List<China> list = chinaService.getCitys(proId);
        return list ;
    }
    @RequestMapping("/area")
    public List<China> getAreaByCity(int cityId){
        List<China> list = chinaService.getAreas(cityId);
        return list ;
    }

}

